package aop_advice;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

public class Logmain {
	public static void main(String[] args){
		Resource rs = new ClassPathResource("aop_advice/beans.xml");
		BeanFactory factory = new XmlBeanFactory(rs);
		
		//Around Advice call
		System.out.println("Around Advice call ---------------------------------------");
		MessageBean bean = (MessageBean)factory.getBean("proxyAround");
		bean.sayHello();
		
		//Before Advice call
		System.out.println("Before Advice call ---------------------------------------");
		bean = (MessageBean)factory.getBean("proxyBefore");
		bean.sayHello();
		
		//After advice call
		System.out.println("After Advice call ---------------------------------------");
		bean = (MessageBean)factory.getBean("proxyAfter");
		bean.sayHello();
		
	}

}
